/*
 * Copyright 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.lansir.af.ui;

import org.lansir.af.R;
import org.lansir.af.gtalk.ui.Settings;
import org.lansir.af.ui.phone.AboutActivity;
import org.lansir.af.ui.phone.ScheduleActivity;
import org.lansir.af.ui.phone.TrustyActivity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class DashboardFragment extends Fragment {
   
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_dashboard, container);

        // Attach event handlers
        root.findViewById(R.id.home_btn_schedule).setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {

                    startActivity(new Intent(getActivity(), ScheduleActivity.class));

                
            }
            
        });

        root.findViewById(R.id.home_btn_gtalk).setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                	Intent intent = new Intent("org.lansir.af.intent.action.ACTION_GTALK");
                	startActivity(intent);
            }
        });

        root.findViewById(R.id.home_btn_calendar).setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                startActivity(new Intent("org.lansir.af.intent.action.ACTION_MODE_VIEW_MONTHCALENDAR"));
             
            }
        });

        root.findViewById(R.id.home_btn_setting).setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
            	startActivity(new Intent(getActivity(), Settings.class));              
            }
        });

        root.findViewById(R.id.home_btn_trusty).setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                // Launch map of conference venue
            	startActivity(new Intent(getActivity(), TrustyActivity.class));

            }
        });

        root.findViewById(R.id.home_btn_about).setOnClickListener(
                new View.OnClickListener() {
                    public void onClick(View view) {
                    	startActivity(new Intent(getActivity(), AboutActivity.class));
                    }
                });

        return root;
    }
}
